<?php
add_action('init', 'create_coupon_post_type');

function create_coupon_post_type()
{
	// REGISTER EVENT TAXONOMY
	register_taxonomy('event', array('coupon'), array(
		'label' => __('Event'),
		'show_ui' => true,
		'rewrite' => array('slug' => 'deals'),
		'hierarchical' => false
        ));

	// REGISTER COUPON CUSTOM POST TYPE
    $icon_path = get_bloginfo('template_directory').'/inc/images/coupon.png';
    
	register_post_type('coupon', array(
		'labels' => array(
			'name' => __('Coupons'),
			'singular_name' => __('Coupon'),
			'add_new' => _x('Add New Coupon', 'coupon'),
			'add_new_item' => __('Add New Coupon'),
			'edit_item' => __('Edit Coupon'),
			'new_item' => __('New Coupon'),
			'view_item' => __('View Coupon'),
			'search_items' => __('Search Coupon')),
		//'rewrite' => array('slug' => 'view-coupon'),
		'public' => true,
		'publicly_queryable' => true,
		'has_archive' => true,
		'hierarchical' => false,
        'menu_icon' => $icon_path,
		'supports' => array(
			'title',
			'editor',
			'author',
			//'thumbnail',
			'comments',
			//'custom-fields',
			'cats',
			//'excerpt',
			'revisions'
            )));
}
?>